package cn.wolfcode.designpattern.command;

/**
 * @author Leon
 * @date 2021/2/28
 */
public class Client {

    public static void main(String[] args) {
        // 接受者
        Processor processor = new Processor();
        // 命令
        Command add = new AddCommand(processor);
        Command subtract = new SubtractCommand(processor);

        // 发送者
        Calculator calc = new Calculator();
        calc.enter(1, 3).setCommand(add).call();
        calc.enter(5, 3).setCommand(subtract).call();
    }
}

